package com.example.springboot3.service.impl;

import com.example.springboot3.context.RequestContext;
import com.example.springboot3.context.UserContext;
import com.example.springboot3.pojo.User;
import com.example.springboot3.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * @author 张琪
 * @date 2024-02-23 14:30
 */
@Service
public class UserServiceImpl implements IUserService {

    @Override
    public String doSomething() {
        User currentUser = RequestContext.getCurrentUser();
        return "当前用户：" + currentUser;
    }

    @Override
    public String doSomething2() {
        String s = UserContext.get();
        return "当前用户：" + s;
    }
}
